home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CD ROM Paradise Collection 4
/
CD ROM Paradise Collection 4 1995 Nov.iso
/
os2
/
adaptor.zip
/
ADAPT.ZIP
/
adaptor
/
examples
/
purdue
/
prob03.fcm
< prev
next >
Wrap
Text File
|
1993-06-26
|
2KB
|
91 lines
PROGRAM PROB03
C
C PROBLEM 3
C
C REFERENCE: PROBLEMS TO TEST PARALLEL AND VECTOR LANGUAGES
C CSD-TR 516, COMPUTER SCIENCE, PURDUE UNIVERSITY
C JOHN R. RICE, MAY 1, 1985
C
C REVISED BY JOHN R. RICE AND J. JING, OCT. 1, 1990
C
C
C *************************************************
C * Adapted for FORTRAN D benchmarking *
C * by T. HAUPT (haupt@sccs.npac.syr.edu) *
C * *
C * Northeast Parallel Architectures Center *
C * at Syracuse University, Syracuse, NY, USA *
C *************************************************
C
C
C VERSION SIMD/CM2-1.00
C ==================================================
C
INCLUDE '/usr/include/cm/paris-configuration-fort.h'
INTEGER KASES,NK,MK
PARAMETER (KASES=3)
INTEGER N(KASES),M(KASES)
cmf$ layout N (:serial)
cmf$ layout M (:serial)
DATA N / 64,512,1024 /
DATA M /128,128,1024 /
REAL S
DO 50 K = 1, KASES
CALL CM_TIMER_CLEAR(0)
CALL CM_TIMER_START(0)
DO MANY=1,50
NK=N(K)
MK=M(K)
CALL DOIT(NK,MK,S)
ENDDO
CALL CM_TIMER_STOP(0)
PRINT 60, N(K),M(K)
60 FORMAT ('PROBLEM 3 WITH N,M =',I6,2X,I6)
PRINT *,'GIVES S =',S
CALL CM_TIMER_PRINT(0)
50 CONTINUE
STOP
END
SUBROUTINE DOIT(NK,MK,S)
INTEGER NK,MK
REAL S
c REAL, ARRAY(NK,MK) :: A
REAL, ARRAY(MK,NK) :: A
REAL, ARRAY (NK) :: H
C
C intitialization
C
A=1.0001
C
C computation
C
c S=SUM(PRODUCT(A,DIM=2))
!HPF$ independent, local_access
do i = 1, nk
H(i) = 1.0
do j = 1, mk
H(i) = H(i) * A(j,i)
end do
end do
S = SUM (H)
END